<%-- 
    Document   : category
    Created on : Mar 29, 2014, 5:54:15 PM
    Author     : windows 7 Ult
--%>
<%@ page import="java.io.*,java.util.*,java.sql.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*" %>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.Statement"%>
<%@page import="java.sql.DriverManager"%>
<%@page import="java.sql.Connection"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>



<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
       
  <sql:setDataSource var="conn" driver="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost/shopping"
     user="root"  password=""/>

<sql:query dataSource="${conn}" var="result">
SELECT id,name from category;
</sql:query>

<ul>
<c:forEach var="row" items="${result.rows}">

<li><a href="page.jsp?catid=<c:out value="${row.id}"/>"><c:out value="${row.name}"/></a></li>

</c:forEach>
</ul>


    </body>
</html>
